<!DOCTYPE html>
<html xmlns:v-validate="http://www.w3.org/1999/xhtml">
<head>
    <title>客户表</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <#if shiro.hasPermission("xm:customer:save")>
                  <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>
            <#if shiro.hasPermission("xm:customer:update")>
                  <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("xm:customer:delete")>
              <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>
            <#if shiro.hasPermission("xm:customer:recharge")>
              <a class="btn btn-primary" @click="recharge"><i class="fa fa-jpy"></i>&nbsp;充值</a>
            </#if>

            <#if shiro.hasPermission("xm:customer:zengsong")>
                <a class="btn btn-primary" @click="zengsong"><i class="fa fa-jpy"></i>&nbsp;赠送</a>
            </#if>

            <#if shiro.hasPermission("xm:customer:pay")>
              <a class="btn btn-primary" @click="pay"><i class="fa fa-scissors"></i>&nbsp;消费</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="addList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
														                    <div class="form-group">
                        <div class="col-sm-2 control-label">客户姓名</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="customer.customerName" placeholder="客户姓名"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">客户手机号码</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="customer.customerTel" placeholder="客户手机号码"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">客户邮箱</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="customer.customerEmail" placeholder="客户邮箱"/>
                        </div>
                    </div>
                                          <div class="form-group">
                      <div class="col-sm-2 control-label">会员卡号</div>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" v-model="customer.vipNo" placeholder="会员卡号"/>
                      </div>
                    </div>
                                          <div class="form-group">
                      <div class="col-sm-2 control-label">账户金额</div>
                      <div class="col-sm-10">
                        <input type="text" class="form-control" v-model="customer.payBalance" placeholder="账户金额"/>
                      </div>
                    </div>
							            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>


    <div v-show="rechargeList" class="panel panel-default">
      <div class="panel-heading">{{title}}</div>
      <form class="form-horizontal">
        <div class="form-group">
          <div class="col-sm-2 control-label">客户姓名</div>
          <div class="col-sm-10">
            <input type="text" class="form-control" v-model="customer.customerName" placeholder="客户姓名"/>
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-2 control-label">账户金额</div>
          <div class="col-sm-10">
            <input type="number" class="form-control" v-model.number="customer.payBalance" readonly placeholder="账户金额"/>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-2 control-label">充值金额</div>
          <div class="col-sm-10">
            <input type="number" class="form-control" v-model.number="customer.balance" placeholder="充值金额"/>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-2 control-label"></div>
          <input type="button" class="btn btn-primary" @click="rechargeMoney" value="确定"/>
          &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
        </div>
      </form>
    </div>


    <div v-show="zengsongList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">客户姓名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="customer.customerName" placeholder="客户姓名" readonly/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">客户手机号码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="customer.customerTel" placeholder="客户手机号码" readonly/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">会员卡号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="customer.vipNo" placeholder="会员卡号" readonly/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">赠送项目</label>

                <div class="col-sm-10">
                    <div class="col-sm-7">
                        <select class="form-control" v-model="customer.productId">
                            <option value="">--请选择--</option>
                            <template v-for="site in proList">
                                <option :value="site.id">{{ site.categoryName }}</option>
                            </template>
                        </select>
                    </div>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" v-model="customer.zengsong"  placeholder="赠送次数"/>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="zsUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>


    <div v-show="payList" class="panel panel-default">
      <div class="panel-heading">{{title}}</div>
      <form class="form-horizontal">
        <div class="form-group">
          <div class="col-sm-2 control-label">客户姓名</div>
          <div class="col-sm-10">
            <input type="text" class="form-control" v-model="customer.customerName" placeholder="客户姓名" readonly/>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-2 control-label">客户手机号码</div>
          <div class="col-sm-10">
            <input type="text" class="form-control" v-model="customer.customerTel" placeholder="客户手机号码" readonly/>
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-2 control-label">会员卡号</div>
          <div class="col-sm-10">
            <input type="text" class="form-control" v-model="customer.vipNo" placeholder="会员卡号" readonly/>
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-2 control-label">余额</div>
          <div class="col-sm-10">
            <input type="text" class="form-control" v-model="customer.payBalance" placeholder="余额" readonly/>
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-2 control-label">服务师傅</div>
          <div class="col-sm-10">
            <select class="form-control" id="sencond" v-model="customer.workId">
              <template v-for="site in workerList">
                <option  :value="site.id"  >{{ site.workerName }}</option>
              </template>
            </select>
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-2 control-label">消费项目</div>
          <div class="col-sm-10">
            <select class="form-control" @change="firstChange" id="first" v-model="customer.productId">
              <option value="">--请选择--</option>
              <template v-for="site in proList">
                <option v-if = "site.categoryVipPrice > 0" :value="site.id" :data-ins="site.categoryPrice" :data-vip="site.categoryVipPrice" >{{ site.categoryName }}-- 单价:{{ site.categoryPrice }}元-- 会员价:{{ site.categoryVipPrice }}元</option>
                <option v-else  :value="site.id" :value="site.id" :data-ins="site.categoryPrice" :data-vip="site.categoryVipPrice" >{{ site.categoryName }}--单价:{{ site.categoryPrice }}元</option>
              </template>
            </select>
          </div>
        </div>

        <div class="form-group">
          <label class="col-sm-2 control-label">赠送项目</label>

          <div class="col-sm-10">
            <!--<div class="row">-->
            <div class="col-sm-7">
              <select class="form-control">
                <option value="">--请选择--</option>
                <template v-for="site in proList">
                  <option :value="site.id">{{ site.categoryName }} -- 剩余:1次</option>
                </template>
              </select>
            </div>
            <div class="col-sm-5">
              <input type="text" class="form-control"  placeholder="本次使用次数"/>
            </div>
            <!--</div>-->
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-2 control-label"></div>
          <input type="button" class="btn btn-primary" @click="payMoney" value="确定"/>
          &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
        </div>
      </form>
    </div>


</div>
<script src="${request.contextPath}/statics/js/modules/xm/customer.js?_${.now?long}"></script>
</body>
</html>